package cn.com.stums.dao.common;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import cn.com.stums.model.common.ParameterDetail;
import cn.com.stums.model.store.StoreParmeter;

public class ParameterDetailImp extends BaseDaoMaster implements ParameterDetailDao{
	public ParameterDetail queryById(int id){
		ParameterDetail bean = null;
		bean = super.getById(ParameterDetail.class, id);
		return bean;
	}
	
	public List queryParmeter(ParameterDetail bean){
		List result = null;
		result = super.find(bean);
		return result;
	}
	
	public StoreParmeter queryStoreParmeterById(int id){
		StoreParmeter bean = null;
		bean = super.getById(ParameterDetail.class, id);
		return bean;
	}
	
	public List queryStoreParmeter(StoreParmeter bean){
		List result = null;
		result = super.find(bean);
		return result;
	}
	
	public List queryAllStoreParmeter(){
		List result = null;
		result = super.getAll(StoreParmeter.class);
		return result;
	}

	public Map queryStoreState(){
		ParameterDetail detailBean = new ParameterDetail();
		detailBean.setStPameterNo("2000");
		List result =  super.find(detailBean);
		HashMap map = new HashMap();
		for(int i=0 ; i< result.size() ; i++){
			ParameterDetail bean = (ParameterDetail) result.get(i);
			map.put(bean.getStPameterName(), bean.getStCode() + "");
		}
		return map;
	}
	
	public Map queryStoreLocation(){
		ParameterDetail detailBean = new ParameterDetail();
		detailBean.setStPameterNo("2010");
		List result =  super.find(detailBean);
		HashMap map = new HashMap();
		for(int i=0 ; i< result.size() ; i++){
			ParameterDetail bean = (ParameterDetail) result.get(i);
			map.put(bean.getStPameterName(), bean.getStCode() + "");
		}
		return map;
	}
}
